package com.wilmer.bank_feedback.service.impl;

import java.util.List;

import com.wilmer.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wilmer.bank_feedback.mapper.BankFeedbackMapper;
import com.wilmer.bank_feedback.domain.BankFeedback;
import com.wilmer.bank_feedback.service.IBankFeedbackService;

/**
 * 意见反馈Service业务层处理
 *
 * @author David
 * @date 2024-04-01
 */
@Service
public class BankFeedbackServiceImpl implements IBankFeedbackService
{
    @Autowired
    private BankFeedbackMapper bankFeedbackMapper;

    /**
     * 查询意见反馈
     *
     * @param UserID 意见反馈主键
     * @return 意见反馈
     */
    @Override
    public BankFeedback selectBankFeedbackByUserID(Long UserID)
    {
        return bankFeedbackMapper.selectBankFeedbackByUserID(UserID);
    }

    /**
     * 查询意见反馈列表
     *
     * @param bankFeedback 意见反馈
     * @return 意见反馈
     */
    @Override
    public List<BankFeedback> selectBankFeedbackList(BankFeedback bankFeedback)
    {
        return bankFeedbackMapper.selectBankFeedbackList(bankFeedback);
    }

    /**
     * 新增意见反馈
     *
     * @param bankFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int insertBankFeedback(BankFeedback bankFeedback)
    {
        bankFeedback.setUserID(SecurityUtils.getLoginUser().getUser().getUserId());
        return bankFeedbackMapper.insertBankFeedback(bankFeedback);
    }

    /**
     * 修改意见反馈
     *
     * @param bankFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int updateBankFeedback(BankFeedback bankFeedback)
    {
        return bankFeedbackMapper.updateBankFeedback(bankFeedback);
    }

    /**
     * 批量删除意见反馈
     *
     * @param UserIDs 需要删除的意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteBankFeedbackByUserIDs(Long[] UserIDs)
    {
        return bankFeedbackMapper.deleteBankFeedbackByUserIDs(UserIDs);
    }

    /**
     * 删除意见反馈信息
     *
     * @param UserID 意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteBankFeedbackByUserID(Long UserID)
    {
        return bankFeedbackMapper.deleteBankFeedbackByUserID(UserID);
    }
}
